package com.macaline.concurrent;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.TimeUnit;

public class BlockingQueueDemo {

    public static void main(String[] args) throws InterruptedException {
        BlockingQueue<String> queue = new ArrayBlockingQueue<String>(3);
        queue.offer("b");
        System.out.println(queue.offer("b"));
        System.out.println(queue.offer("b"));
        queue.offer("w", 3L, TimeUnit.SECONDS);


    }
}
